package de.toolschmied.jjas.client.cms;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

import de.toolschmied.jjas.shared.Content;
import de.toolschmied.jjas.shared.Page;

public class PageView extends Composite {

	private final FlowPanel panel = new FlowPanel();
	
	private final Page page;
	
	public PageView(Page page) {
		this.page = page;
		
		for (Content content : page.getContents()) {
			addContent(content);
		}
		
		initWidget(panel);
	}

	private void addContent(Content content) {
		Widget widget = ViewFactory.getView(content);
		panel.add(widget);
	}
	
}
